package com.nova.bluetooth.xunFeiSDK;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import com.nova.bluetooth.R;
import com.nova.bluetooth.xunFeiSDK.kugouMusic.KugouDemo;
import com.nova.bluetooth.xunFeiSDK.mainFunction.AsrActivity;
import com.nova.bluetooth.xunFeiSDK.mainFunction.InteractActivity;
import com.nova.bluetooth.xunFeiSDK.mainFunction.LocalTTSActivity;
import com.nova.bluetooth.xunFeiSDK.mainFunction.TTSActivity;
import com.nova.bluetooth.xunFeiSDK.mainFunction.WakeupActivity;
import com.nova.bluetooth.xunFeiSDK.optionalFunction.DynamicEntityActivity;
import com.nova.bluetooth.xunFeiSDK.optionalFunction.InteractCertainTimeActivity;
import com.nova.bluetooth.xunFeiSDK.optionalFunction.ReadFileTest_Asr;
import com.nova.bluetooth.xunFeiSDK.optionalFunction.ReadFileTest_DenoiseAndAsr;
import com.nova.bluetooth.xunFeiSDK.optionalFunction.ReadFileTest_Zhaiboshu;
import com.nova.bluetooth.xunFeiSDK.optionalFunction.SayWhenSeeingActivity;
import com.nova.bluetooth.xunFeiSDK.optionalFunction.TextNlpActivity;
import com.nova.bluetooth.xunFeiSDK.utils.FileUtil;


public class MainDemoActivity extends Activity implements View.OnClickListener {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_demo);
        initLayout();
        FileUtil.requestPermissions(this);

    }

    private void initLayout() {
        findViewById(R.id.wakeup).setOnClickListener(this);
        findViewById(R.id.asr).setOnClickListener(this);
        findViewById(R.id.online_tts).setOnClickListener(this);
        findViewById(R.id.offline_tts).setOnClickListener(this);
        findViewById(R.id.interactDemo).setOnClickListener(this);
        findViewById(R.id.interactCertainTime).setOnClickListener(this);
        findViewById(R.id.textNlp).setOnClickListener(this);
        findViewById(R.id.dynamicEntity).setOnClickListener(this);
        findViewById(R.id.dynamicEntitySayWhenseeing).setOnClickListener(this);
        findViewById(R.id.ReadFileTest_Asr).setOnClickListener(this);
        findViewById(R.id.ReadFileTest_DenoiseAndAsr).setOnClickListener(this);
        findViewById(R.id.ReadFileTest_Zhaiboshu).setOnClickListener(this);
        findViewById(R.id.kugouMusic).setOnClickListener(this);
    }

    @Override
    public void onClick(View view) {
        int id = view.getId();
        if (id == R.id.wakeup) {
            startActivity(new Intent(MainDemoActivity.this, WakeupActivity.class));
        } else if (id == R.id.asr) {
            startActivity(new Intent(MainDemoActivity.this, AsrActivity.class));
        } else if (id == R.id.online_tts) {
            startActivity(new Intent(MainDemoActivity.this, TTSActivity.class));
        } else if (id == R.id.offline_tts) {
            startActivity(new Intent(MainDemoActivity.this, LocalTTSActivity.class));
        } else if (id == R.id.interactDemo) {
            startActivity(new Intent(MainDemoActivity.this, InteractActivity.class));
        } else if (id == R.id.interactCertainTime) {
            startActivity(new Intent(MainDemoActivity.this, InteractCertainTimeActivity.class));
        } else if (id == R.id.textNlp) {
            startActivity(new Intent(MainDemoActivity.this, TextNlpActivity.class));
        } else if (id == R.id.dynamicEntity) {
            startActivity(new Intent(MainDemoActivity.this, DynamicEntityActivity.class));
        } else if (id == R.id.dynamicEntitySayWhenseeing) {
            startActivity(new Intent(MainDemoActivity.this, SayWhenSeeingActivity.class));
        } else if (id == R.id.ReadFileTest_Asr) {
            startActivity(new Intent(MainDemoActivity.this, ReadFileTest_Asr.class));
        } else if (id == R.id.ReadFileTest_DenoiseAndAsr) {
            startActivity(new Intent(MainDemoActivity.this, ReadFileTest_DenoiseAndAsr.class));
        } else if (id == R.id.ReadFileTest_Zhaiboshu) {
            startActivity(new Intent(MainDemoActivity.this, ReadFileTest_Zhaiboshu.class));
        } else if (id == R.id.kugouMusic) {
            startActivity(new Intent(MainDemoActivity.this, KugouDemo.class));
        }
    }
}
